#include<iostream>
#include<sys/wait.h>
#include<unistd.h>
#include<sys/types.h>

int main()
{
    pid_t pid = fork();
    if(pid == 0)
    {
	sleep(1);
	int a = 10;
	a/=0;

	exit(0);
    }
    int status = 0;
    waitpid(-1,&status,0);
    printf("exit signal: %d,core dump %d \n",status&0x7F,(status>>7)&1);
    return 0;
}
